<?php

namespace app\common\model;

use think\Model;

/**
 * t_merchant 租户
 * @property integer $id (主键)
 * @property string $tenant_id 租户唯一标识
 * @property string $name 商户名称
 * @property string $expire_time 过期时间
 * @property string $created_at 创建时间
 * @property integer $category_id 租户类型
 * @property string $category_name 类型名称
 * @property string $source 租户来源
 * @property integer $status 0 正常 1过期 2停用
 * @property string $remark 备注
 */
class Merchant extends Model
{
    /**
     * The connection name for the model.
     *
     * @var string|null
     */
    protected $connection = 'mysql';

    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 't_merchant';

    /**
     * The primary key associated with the table.
     *
     * @var string
     */
    protected $pk = 'id';

    function category()
    {
        return $this->hasOne(SysMerchantCategory::class, 'id', 'category_id');
    }
}
